<%- if @elements.blank? -%>
<div id="trash_empty_notice" <%= @elements.blank? ? '' : 'style="display: none"' %> class="info">
  <%= render_icon('info') %>
  <%= Alchemy.t('Your trash is empty') %>
</div>
<%- else -%>
<%= render_message do %>
  <%= Alchemy.t('Drag an element over to the element window to restore it') %>
<% end %>
<div id="trash_items">
<%- @elements.each do |element| -%>
  <%= render partial: 'alchemy/admin/elements/element',
    object: element,
    locals: {
      draggable: @allowed_elements.any? do |e|
        e['name'] == element.name || e.fetch('nestable_elements', []).include?(element.name)
      end
    } %>
<%- end -%>
</div>
<p>
  <%= link_to_confirm_dialog Alchemy.t('clear trash'),
    Alchemy.t('Do you really want to clear the trash?'),
    alchemy.clear_admin_trash_path(page_id: @page.id),
    class: 'button' %>
</p>
<%- end -%>
<script type="text/javascript" charset="utf-8">
  Alchemy.DraggableTrashItems();
  Alchemy.TrashWindow.updateIcon();
</script>
